package com.wangsd.web.shop.mapper;

import com.gitee.fastmybatis.core.mapper.CrudMapper;
import com.wangsd.web.shop.entity.Trade;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TradeMapper extends CrudMapper<Trade, Long> {
    @Select("select * from trade where  created_time < (select date_sub(NOW(), interval 5 MINUTE)) and status=0 and is_deleted=0")
    List<Trade> selectByQuery();

    @Select("select * from trade where outTradeNo=#{outTradeNo} and is_deleted=0")
    Trade selectByOutTradeNoDelete(String outTradeNo);
}
